home *** CD-ROM | disk | FTP | other *** search
- /*****************************************************************************
- MODULE: rputf.c
- PURPOSE: recio character delimited floating point input functions
- COPYRIGHT: (C) 1994 William Pierpoint
- COMPILER: Borland C Version 3.1
- OS: MSDOS Version 6.2
- VERSION: 2.00
- RELEASE: April 15, 1994
- *****************************************************************************/
-
- #include <errno.h>
- #include <float.h>
- #include <limits.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-
- #include "_rputf.h"
-
- /****************************************************************************/
- char * /* return pointer to string */
- dtoa( /* convert floating point number to string */
- double d, /* number to convert */
- int dig, /* number of significant digits */
- char *str) /* string buffer to use */
- /****************************************************************************/
- {
- sprintf(str, "%.*G", dig, d);
- return str;
- }
-
- /****************************************************************************/
- /* rput_fn() - define rput functions */
- /****************************************************************************/
-
- rput_fn(float, rputf, double, dtoa, FLT_DIG)
- rput_fn(double, rputd, double, dtoa, DBL_DIG)
-
-